package org.lee.status.app.event;

import lombok.extern.slf4j.Slf4j;
import org.lee.status.app.Result;
import org.lee.status.app.State;
import org.lee.status.app.activity.ActivityService;
import org.lee.status.app.activity.Status;

/**
 * EditingState
 * 编辑
 *
 * @author dralee
 * @date 2021-11-24 09:43:43
 **/
@Slf4j
public class EditingState extends State {
    @Override
    public Result arraignment(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.CHECK);
        return Result.success("活动提审成功");
    }

    @Override
    public Result checkPass(String activityId, Status currentStatus) {
        return Result.failure("编辑中不可审核通过");
    }

    @Override
    public Result checkRefuse(String activityId, Status currentStatus) {
        return Result.failure("编辑中不可审核拒绝");
    }

    @Override
    public Result checkRevoke(String activityId, Status currentStatus) {
        return Result.failure("编辑中不可撤消审核");
    }

    @Override
    public Result close(String activityId, Status currentStatus) {
        return Result.success("活动关闭成功");
    }

    @Override
    public Result open(String activityId, Status currentStatus) {
        return Result.failure("非关闭活动不可开启");
    }

    @Override
    public Result doing(String activityId, Status currentStatus) {
        return Result.failure("编辑中不可执行活动中变更");
    }
}
